<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Users extends Front_Controller
{
    function __construct()
    {
        parent::__construct();
    }

    function index()
    {
        return $this->smarty->display('login');
    }

    function login()
    {
        $this->load->model('users_model');
        $this->users_model->login($this->input->post('username'), $this->input->post('password'));
        redirect(base_url());
    }

    function logout()
    {
        $this->load->model('users_model');
        $this->users_model->logout();
        redirect(base_url());
    }
    
    function register()
    {
        return $this->smarty->display('register');
    }
    
    function recharge()
    {
        return $this->smarty->display('recharge');
    }
}